/**
 * This Class will Print 1 to 10 numbers using for each loop or enhanced for loop
 * @author Ravi
 *
 */


public class ForEachLoopDemo {

  public static void main(String[] args) {
  int[] count = new int[10];


      int k = 1;
//This for loop is storing 1 to 10 value into the count array.
  for (int i=0; i < 10; i++){
   count[i] = k;
   System.out.println("Stored value in count["+i+"] arrray is " + count[i]);
   k++;
  }
//This enhanced or for each loop is used for displaying the value stored in the array count
 for(int tempCount : count){
   System.out.println(tempCount);
  }
 }
}